Integrand size = 13, antiderivative size = 82 \[ \int \frac {\sin ^2(x)}{a+b \csc (x)} \, dx=\frac {\left (a^2+2 b^2\right ) x}{2 a^3}+\frac {2 b^3 \text {arctanh}\left (\frac {a+b \tan \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{a^3 \sqrt {a^2-b^2}}+\frac {b \cos (x)}{a^2}-\frac {\cos (x) \sin (x)}{2 a} \]
1/2*(a^2+2*b^2)*x/a^3+b*cos(x)/a^2-1/2*cos(x)*sin(x)/a+2*b^3*arctanh((a+b* tan(1/2*x))/(a^2-b^2)^(1/2))/a^3/(a^2-b^2)^(1/2)
Time = 0.36 (sec) , antiderivative size = 78, normalized size of antiderivative = 0.95 \[ \int \frac {\sin ^2(x)}{a+b \csc (x)} \, dx=\frac {2 a^2 x+4 b^2 x-\frac {8 b^3 \arctan \left (\frac {a+b \tan \left (\frac {x}{2}\right )}{\sqrt {-a^2+b^2}}\right )}{\sqrt {-a^2+b^2}}+4 a b \cos (x)-a^2 \sin (2 x)}{4 a^3} \]
(2*a^2*x + 4*b^2*x - (8*b^3*ArcTan[(a + b*Tan[x/2])/Sqrt[-a^2 + b^2]])/Sqr t[-a^2 + b^2] + 4*a*b*Cos[x] - a^2*Sin[2*x])/(4*a^3)
Time = 0.67 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.26, number of steps used = 14, number of rules used = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.000, Rules used = {3042, 4340, 25, 3042, 4592, 3042, 4407, 3042, 4318, 3042, 3139, 1083, 219}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\sin ^2(x)}{a+b \csc (x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\csc (x)^2 (a+b \csc (x))}dx\) |
\(\Big \downarrow \) 4340 |
\(\displaystyle \frac {\int -\frac {\left (-b \csc ^2(x)-a \csc (x)+2 b\right ) \sin (x)}{a+b \csc (x)}dx}{2 a}-\frac {\sin (x) \cos (x)}{2 a}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\frac {\int \frac {\left (-b \csc ^2(x)-a \csc (x)+2 b\right ) \sin (x)}{a+b \csc (x)}dx}{2 a}-\frac {\sin (x) \cos (x)}{2 a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {\int \frac {-b \csc (x)^2-a \csc (x)+2 b}{\csc (x) (a+b \csc (x))}dx}{2 a}-\frac {\sin (x) \cos (x)}{2 a}\) |
\(\Big \downarrow \) 4592 |
\(\displaystyle -\frac {-\frac {\int \frac {a^2+b \csc (x) a+2 b^2}{a+b \csc (x)}dx}{a}-\frac {2 b \cos (x)}{a}}{2 a}-\frac {\sin (x) \cos (x)}{2 a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {-\frac {\int \frac {a^2+b \csc (x) a+2 b^2}{a+b \csc (x)}dx}{a}-\frac {2 b \cos (x)}{a}}{2 a}-\frac {\sin (x) \cos (x)}{2 a}\) |
\(\Big \downarrow \) 4407 |
\(\displaystyle -\frac {-\frac {\frac {x \left (a^2+2 b^2\right )}{a}-\frac {2 b^3 \int \frac {\csc (x)}{a+b \csc (x)}dx}{a}}{a}-\frac {2 b \cos (x)}{a}}{2 a}-\frac {\sin (x) \cos (x)}{2 a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {-\frac {\frac {x \left (a^2+2 b^2\right )}{a}-\frac {2 b^3 \int \frac {\csc (x)}{a+b \csc (x)}dx}{a}}{a}-\frac {2 b \cos (x)}{a}}{2 a}-\frac {\sin (x) \cos (x)}{2 a}\) |
\(\Big \downarrow \) 4318 |
\(\displaystyle -\frac {-\frac {\frac {x \left (a^2+2 b^2\right )}{a}-\frac {2 b^2 \int \frac {1}{\frac {a \sin (x)}{b}+1}dx}{a}}{a}-\frac {2 b \cos (x)}{a}}{2 a}-\frac {\sin (x) \cos (x)}{2 a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {-\frac {\frac {x \left (a^2+2 b^2\right )}{a}-\frac {2 b^2 \int \frac {1}{\frac {a \sin (x)}{b}+1}dx}{a}}{a}-\frac {2 b \cos (x)}{a}}{2 a}-\frac {\sin (x) \cos (x)}{2 a}\) |
\(\Big \downarrow \) 3139 |
\(\displaystyle -\frac {-\frac {\frac {x \left (a^2+2 b^2\right )}{a}-\frac {4 b^2 \int \frac {1}{\tan ^2\left (\frac {x}{2}\right )+\frac {2 a \tan \left (\frac {x}{2}\right )}{b}+1}d\tan \left (\frac {x}{2}\right )}{a}}{a}-\frac {2 b \cos (x)}{a}}{2 a}-\frac {\sin (x) \cos (x)}{2 a}\) |
\(\Big \downarrow \) 1083 |
\(\displaystyle -\frac {-\frac {\frac {8 b^2 \int \frac {1}{-\left (\frac {2 a}{b}+2 \tan \left (\frac {x}{2}\right )\right )^2-4 \left (1-\frac {a^2}{b^2}\right )}d\left (\frac {2 a}{b}+2 \tan \left (\frac {x}{2}\right )\right )}{a}+\frac {x \left (a^2+2 b^2\right )}{a}}{a}-\frac {2 b \cos (x)}{a}}{2 a}-\frac {\sin (x) \cos (x)}{2 a}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle -\frac {-\frac {\frac {4 b^3 \text {arctanh}\left (\frac {b \left (\frac {2 a}{b}+2 \tan \left (\frac {x}{2}\right )\right )}{2 \sqrt {a^2-b^2}}\right )}{a \sqrt {a^2-b^2}}+\frac {x \left (a^2+2 b^2\right )}{a}}{a}-\frac {2 b \cos (x)}{a}}{2 a}-\frac {\sin (x) \cos (x)}{2 a}\) |
-1/2*(-((((a^2 + 2*b^2)*x)/a + (4*b^3*ArcTanh[(b*((2*a)/b + 2*Tan[x/2]))/( 2*Sqrt[a^2 - b^2])])/(a*Sqrt[a^2 - b^2]))/a) - (2*b*Cos[x])/a)/a - (Cos[x] *Sin[x])/(2*a)
3.1.46.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2 Subst[I nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x]
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = Fre eFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d) Subst[Int[1/(a + 2*b*e*x + a *e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] && NeQ [a^2 - b^2, 0]
Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbo l] :> Simp[1/b Int[1/(1 + (a/b)*Sin[e + f*x]), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)/(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( a_)), x_Symbol] :> Simp[Cot[e + f*x]*((d*Csc[e + f*x])^n/(a*f*n)), x] - Sim p[1/(a*d*n) Int[((d*Csc[e + f*x])^(n + 1)/(a + b*Csc[e + f*x]))*Simp[b*n - a*(n + 1)*Csc[e + f*x] - b*(n + 1)*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a , b, d, e, f}, x] && NeQ[a^2 - b^2, 0] && LeQ[n, -1] && IntegerQ[2*n]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[c*(x/a), x] - Simp[(b*c - a*d)/a Int[Csc[e + f* x]/(a + b*Csc[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. ))*(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a _))^(m_), x_Symbol] :> Simp[A*Cot[e + f*x]*(a + b*Csc[e + f*x])^(m + 1)*((d *Csc[e + f*x])^n/(a*f*n)), x] + Simp[1/(a*d*n) Int[(a + b*Csc[e + f*x])^m *(d*Csc[e + f*x])^(n + 1)*Simp[a*B*n - A*b*(m + n + 1) + a*(A + A*n + C*n)* Csc[e + f*x] + A*b*(m + n + 2)*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a, b, d , e, f, A, B, C, m}, x] && NeQ[a^2 - b^2, 0] && LeQ[n, -1]
Time = 0.54 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.37
method | result | size |
default | \(\frac {\frac {2 \left (\frac {a^{2} \tan \left (\frac {x}{2}\right )^{3}}{2}+a b \tan \left (\frac {x}{2}\right )^{2}-\frac {\tan \left (\frac {x}{2}\right ) a^{2}}{2}+a b \right )}{\left (1+\tan \left (\frac {x}{2}\right )^{2}\right )^{2}}+\left (a^{2}+2 b^{2}\right ) \arctan \left (\tan \left (\frac {x}{2}\right )\right )}{a^{3}}-\frac {2 b^{3} \arctan \left (\frac {2 b \tan \left (\frac {x}{2}\right )+2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{a^{3} \sqrt {-a^{2}+b^{2}}}\) | \(112\) |
risch | \(\frac {x}{2 a}+\frac {x \,b^{2}}{a^{3}}+\frac {b \,{\mathrm e}^{i x}}{2 a^{2}}+\frac {b \,{\mathrm e}^{-i x}}{2 a^{2}}-\frac {b^{3} \ln \left ({\mathrm e}^{i x}+\frac {i b \sqrt {a^{2}-b^{2}}-a^{2}+b^{2}}{\sqrt {a^{2}-b^{2}}\, a}\right )}{\sqrt {a^{2}-b^{2}}\, a^{3}}+\frac {b^{3} \ln \left ({\mathrm e}^{i x}+\frac {i b \sqrt {a^{2}-b^{2}}+a^{2}-b^{2}}{\sqrt {a^{2}-b^{2}}\, a}\right )}{\sqrt {a^{2}-b^{2}}\, a^{3}}-\frac {\sin \left (2 x \right )}{4 a}\) | \(176\) |
2/a^3*((1/2*a^2*tan(1/2*x)^3+a*b*tan(1/2*x)^2-1/2*tan(1/2*x)*a^2+a*b)/(1+t an(1/2*x)^2)^2+1/2*(a^2+2*b^2)*arctan(tan(1/2*x)))-2*b^3/a^3/(-a^2+b^2)^(1 /2)*arctan(1/2*(2*b*tan(1/2*x)+2*a)/(-a^2+b^2)^(1/2))
Time = 0.26 (sec) , antiderivative size = 285, normalized size of antiderivative = 3.48 \[ \int \frac {\sin ^2(x)}{a+b \csc (x)} \, dx=\left [\frac {\sqrt {a^{2} - b^{2}} b^{3} \log \left (\frac {{\left (a^{2} - 2 \, b^{2}\right )} \cos \left (x\right )^{2} + 2 \, a b \sin \left (x\right ) + a^{2} + b^{2} + 2 \, {\left (b \cos \left (x\right ) \sin \left (x\right ) + a \cos \left (x\right )\right )} \sqrt {a^{2} - b^{2}}}{a^{2} \cos \left (x\right )^{2} - 2 \, a b \sin \left (x\right ) - a^{2} - b^{2}}\right ) - {\left (a^{4} - a^{2} b^{2}\right )} \cos \left (x\right ) \sin \left (x\right ) + {\left (a^{4} + a^{2} b^{2} - 2 \, b^{4}\right )} x + 2 \, {\left (a^{3} b - a b^{3}\right )} \cos \left (x\right )}{2 \, {\left (a^{5} - a^{3} b^{2}\right )}}, \frac {2 \, \sqrt {-a^{2} + b^{2}} b^{3} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \sin \left (x\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \cos \left (x\right )}\right ) - {\left (a^{4} - a^{2} b^{2}\right )} \cos \left (x\right ) \sin \left (x\right ) + {\left (a^{4} + a^{2} b^{2} - 2 \, b^{4}\right )} x + 2 \, {\left (a^{3} b - a b^{3}\right )} \cos \left (x\right )}{2 \, {\left (a^{5} - a^{3} b^{2}\right )}}\right ] \]
[1/2*(sqrt(a^2 - b^2)*b^3*log(((a^2 - 2*b^2)*cos(x)^2 + 2*a*b*sin(x) + a^2 + b^2 + 2*(b*cos(x)*sin(x) + a*cos(x))*sqrt(a^2 - b^2))/(a^2*cos(x)^2 - 2 *a*b*sin(x) - a^2 - b^2)) - (a^4 - a^2*b^2)*cos(x)*sin(x) + (a^4 + a^2*b^2 - 2*b^4)*x + 2*(a^3*b - a*b^3)*cos(x))/(a^5 - a^3*b^2), 1/2*(2*sqrt(-a^2 + b^2)*b^3*arctan(-sqrt(-a^2 + b^2)*(b*sin(x) + a)/((a^2 - b^2)*cos(x))) - (a^4 - a^2*b^2)*cos(x)*sin(x) + (a^4 + a^2*b^2 - 2*b^4)*x + 2*(a^3*b - a* b^3)*cos(x))/(a^5 - a^3*b^2)]
\[ \int \frac {\sin ^2(x)}{a+b \csc (x)} \, dx=\int \frac {\sin ^{2}{\left (x \right )}}{a + b \csc {\left (x \right )}}\, dx \]
Exception generated. \[ \int \frac {\sin ^2(x)}{a+b \csc (x)} \, dx=\text {Exception raised: ValueError} \]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?` f or more de
Time = 0.27 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.37 \[ \int \frac {\sin ^2(x)}{a+b \csc (x)} \, dx=-\frac {2 \, {\left (\pi \left \lfloor \frac {x}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (b\right ) + \arctan \left (\frac {b \tan \left (\frac {1}{2} \, x\right ) + a}{\sqrt {-a^{2} + b^{2}}}\right )\right )} b^{3}}{\sqrt {-a^{2} + b^{2}} a^{3}} + \frac {{\left (a^{2} + 2 \, b^{2}\right )} x}{2 \, a^{3}} + \frac {a \tan \left (\frac {1}{2} \, x\right )^{3} + 2 \, b \tan \left (\frac {1}{2} \, x\right )^{2} - a \tan \left (\frac {1}{2} \, x\right ) + 2 \, b}{{\left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right )}^{2} a^{2}} \]
-2*(pi*floor(1/2*x/pi + 1/2)*sgn(b) + arctan((b*tan(1/2*x) + a)/sqrt(-a^2 + b^2)))*b^3/(sqrt(-a^2 + b^2)*a^3) + 1/2*(a^2 + 2*b^2)*x/a^3 + (a*tan(1/2 *x)^3 + 2*b*tan(1/2*x)^2 - a*tan(1/2*x) + 2*b)/((tan(1/2*x)^2 + 1)^2*a^2)
Time = 20.24 (sec) , antiderivative size = 1147, normalized size of antiderivative = 13.99 \[ \int \frac {\sin ^2(x)}{a+b \csc (x)} \, dx=\text {Too large to display} \]
((2*b)/a^2 - tan(x/2)/a + tan(x/2)^3/a + (2*b*tan(x/2)^2)/a^2)/(2*tan(x/2) ^2 + tan(x/2)^4 + 1) - (atan((40*b^3*tan(x/2))/(8*a^2*b + 40*b^3 + (48*b^5 )/a^2) + (48*b^5*tan(x/2))/(8*a^4*b + 48*b^5 + 40*a^2*b^3) + (8*a*b*tan(x/ 2))/(8*a*b + (40*b^3)/a + (48*b^5)/a^3))*(a^2*1i + b^2*2i)*1i)/a^3 + (b^3* atan(((b^3*(a^2 - b^2)^(1/2)*((8*(4*a^2*b^6 + 4*a^4*b^4 + a^6*b^2))/a^5 + (8*tan(x/2)*(2*a^8*b - 8*a^2*b^7 + 4*a^4*b^5 + 7*a^6*b^3))/a^6 + (b^3*(a^2 - b^2)^(1/2)*(64*b^4*tan(x/2) + (8*(2*a^8*b + 2*a^6*b^3))/a^5 + (b^3*(a^2 - b^2)^(1/2)*(32*a^3*b^2 + (8*tan(x/2)*(12*a^10*b - 8*a^8*b^3))/a^6))/(a^ 5 - a^3*b^2)))/(a^5 - a^3*b^2))*1i)/(a^5 - a^3*b^2) + (b^3*(a^2 - b^2)^(1/ 2)*((8*(4*a^2*b^6 + 4*a^4*b^4 + a^6*b^2))/a^5 + (8*tan(x/2)*(2*a^8*b - 8*a ^2*b^7 + 4*a^4*b^5 + 7*a^6*b^3))/a^6 - (b^3*(a^2 - b^2)^(1/2)*(64*b^4*tan( x/2) + (8*(2*a^8*b + 2*a^6*b^3))/a^5 - (b^3*(a^2 - b^2)^(1/2)*(32*a^3*b^2 + (8*tan(x/2)*(12*a^10*b - 8*a^8*b^3))/a^6))/(a^5 - a^3*b^2)))/(a^5 - a^3* b^2))*1i)/(a^5 - a^3*b^2))/((16*(2*b^7 + a^2*b^5))/a^5 + (16*tan(x/2)*(8*b ^8 + 8*a^2*b^6 + 2*a^4*b^4))/a^6 + (b^3*(a^2 - b^2)^(1/2)*((8*(4*a^2*b^6 + 4*a^4*b^4 + a^6*b^2))/a^5 + (8*tan(x/2)*(2*a^8*b - 8*a^2*b^7 + 4*a^4*b^5 + 7*a^6*b^3))/a^6 + (b^3*(a^2 - b^2)^(1/2)*(64*b^4*tan(x/2) + (8*(2*a^8*b + 2*a^6*b^3))/a^5 + (b^3*(a^2 - b^2)^(1/2)*(32*a^3*b^2 + (8*tan(x/2)*(12*a ^10*b - 8*a^8*b^3))/a^6))/(a^5 - a^3*b^2)))/(a^5 - a^3*b^2)))/(a^5 - a^3*b ^2) - (b^3*(a^2 - b^2)^(1/2)*((8*(4*a^2*b^6 + 4*a^4*b^4 + a^6*b^2))/a^5...